'''
LastEditors: 杜康
LastEditTime: 2021-11-29 15:38:50
'''
from urllib.request import urlopen
from bs4 import BeautifulSoup

html = urlopen('http://www.pythonscraping.com/pages/page1.html')
# BeautifulSoup需要两个参数 html文本 指定文本使用到的解析器
bs = BeautifulSoup(html.read(), 'html.parser')
print(bs)
print('--- --- --- --- --- ---')
print(bs.h1)